import Vue from "vue";
import VueRouter from "vue-router";

import Layout from "./views/layout/index.vue";
import Login from "./views/Login.vue";

import Films from "./views/layout/films/index.vue";
import Cinemas from "./views/layout/cinemas/index.vue";
import Center from "./views/layout/center/index.vue";

import xxx from "./views/layout/films/nowPlaying/index.vue";
import yyy from "./views/layout/films/comingSoon/index.vue";

Vue.use(VueRouter);

const router = new VueRouter({
  routes: [
    {
      path: "/",
      component: Layout,
      children: [
        {
          path: "films",
          component: Films,
          redirect: "/films/nowPlaying",
          children: [
            {
              path: "nowPlaying",
              component: xxx,
            },
            {
              path: "comingSoon",
              component: yyy,
            },
          ],
        },
        {
          path: "cinemas",
          component: Cinemas,
        },
        {
          path: "center",
          component: Center,
        },
      ],
    },
    {
      path: "/login",
      component: Login,
    },
  ],
});

export default router;
